﻿using System;
using System.Collections;

namespace NetTopologySuite.Planargraph
{
	public abstract class GraphComponent
	{
		public static void SetVisited(IEnumerator i, bool visited)
		{
			while (i.MoveNext())
			{
				object obj = i.Current;
				((GraphComponent)obj).Visited = visited;
			}
		}

		public static void SetMarked(IEnumerator i, bool marked)
		{
			while (i.MoveNext())
			{
				object obj = i.Current;
				((GraphComponent)obj).Marked = marked;
			}
		}

		public static GraphComponent GetComponentWithVisitedState(IEnumerator i, bool visitedState)
		{
			while (i.MoveNext())
			{
				object obj = i.Current;
				GraphComponent graphComponent = (GraphComponent)obj;
				if (graphComponent.IsVisited == visitedState)
				{
					return graphComponent;
				}
			}
			return null;
		}

		public bool IsVisited
		{
			get
			{
				return this.Visited;
			}
		}

		public bool Visited { get; set; }

		public bool IsMarked
		{
			get
			{
				return this.Marked;
			}
		}

		public bool Marked { get; set; }

		public abstract bool IsRemoved { get; }

		public object Data { get; set; }
	}
}
